#ifndef AppUi_h
#define AppUi_h

#include <eikapp.h>
#include <eikdoc.h>
#include <e32std.h>
#include <coeccntx.h>
#include <aknviewappui.h>
#include <akntabgrp.h>
#include <aknnavide.h>

#include "Settings.h"
#include "ClientServerCommon.h"
#include "ObserveServerSession.h"
#include "AknNotifyStd.h"
#include <aknnotewrappers.h> 

class CAutolockView;
class CAknGlobalNote;

#define DefAppUi 	CAppUi* appUi = (CAppUi*) CEikonEnv::Static()->EikAppUi();

class CHelpNotes: public CBase
{
public:
	enum THelpNoteId { 
		EMrLockDisabled,
		EMrLockEnabled,
		};
	CHelpNotes();
	~CHelpNotes();
	void ConstructL();
	void ShowHelpNoteL( THelpNoteId aNoteId );

private:
	void SaveArrayL();
	void LoadArrayL();

	RArray< TInt > iDontShowNotes;
};

class CAppUi : public CAknViewAppUi
{
public:
	CAppUi();
    void ConstructL();
    virtual ~CAppUi();
	void ShowTabsL(TInt aStartInd);
	void HideTabsL();
	TDes& GetR(TInt aResId);
	void ShowMessageL(const TDesC& aText, TAknGlobalNoteType aType = EAknGlobalInformationNote);
	void ShowErrorNoteL(TInt aResId);
	void ShowHelpNoteL( CHelpNotes::THelpNoteId aNoteId );
	static TInt StartLinkL(TAny* aObj);
	void StartUrlL(const TDesC& aUrl);
	TBool EnoughSpace(TBool aShowNote = ETrue);
protected: // from MCoeMessageObserver
	virtual void HandleResourceChangeL(TInt aType);
	virtual void HandleForegroundEventL(TBool aForeground);
protected:
	void HandleCommandL(TInt aCommand);
	void ShowPrivacyDialogL();
	virtual TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
	void HandleNotifyL(const TUid aUid, const TDesC& aKey, const TDesC& aValue);
private:
	CAknGlobalNote* iGlobalNote;
	CAknErrorNote* iErrorNote;
	CHelpNotes* iHelpNotes;
	TBuf<300> iTempText;
	CAknNavigationDecorator* iNaviTabs;
public:
	CAutolockView* iAutolockView;
	RObserverSession iObserver;
};

#endif

